import { lazy } from 'react';
import { withKeepAlive, } from "keepalive-react-component";
import Home from '../views/Home';

const routes = [{
    path: '/',
    name: 'home',
    // component: withKeepAlive( Home ,{cacheId:'Home' ,scroll:true })  ,
    component: withKeepAlive(Home, { cacheId: 'Home', scroll: true }),
    meta: {
        title: '知乎日报-WebApp',
    },
},
{
    path: '/detail/:id', name: 'detail',
    // component: lazy(() => import('../views/Detail')),
    component: lazy(() => import('../views/Detail')),
    meta: {
        title: '新闻'
    },
},
{
    path: '/personal', name: 'Personal',
    component: lazy(() => import('../views/Personal')),
    meta: {
        title: '个人中心'
    },
},
{
    path: '/store', name: 'Store',
    component: lazy(() => import('../views/Store')),
    meta: {
        title: '收藏'
    },
},
{
    path: '/update', name: 'Update',
    component: lazy(() => import('../views/Update')),
    meta: {
        title: '个人信息修改'
    },
}, {
    path: '/login', name: 'Login',
    component: lazy(() => import('../views/Login')),
    meta: {
        title: '登陆'
    },
},
{
    path: '*', name: 'Page404',
    component: lazy(() => import('../views/Page404')),
    meta: {
        title: '04'
    },
},
];
export default routes;